<h1 class="title">Enquetes</h1>
<?php if($this->rowcount > 0) { ?>
	<form enctype="multipart/form-data" action="<?php echo $this->url(array('action'=>'vote')); ?>" method="post">
		<?php foreach($this->list_poll as $list_poll) : ?>
			<h2><strong><?php echo $list_poll['question']; ?></strong></h2>
			<?php $id_question = $list_poll['id']; ?>
			<div class="hide"><input type="hidden" name="id_question" value="<?php echo $list_poll['id']; ?>" /></div>
		<?php endforeach; ?>
		<?php foreach($this->list_answer as $list_answer) : ?>
			<input type="radio" name="id_answer" value="<?php echo $list_answer['id']; ?>" /> <?php echo $list_answer['answer']; ?><br />
		<?php endforeach; ?>
		<div class="prepend-top"><input type="submit" value="Votar" name="vote" /></div>
	</form>
	<a href="<?php echo $this->url(array('action'=>'result','id'=>$id_question)); ?>" title="Ver Resultado">Ver Resultado</a>
<?php } else { ?>
	<div class="clear error prepend-top">Nenhum registro encontrado.</div>
<?php } ?>